<template>
	<view class="viewpage">
		<v-table :columns="columns" :list="data"></v-table>
	</view>
</template>

<script>
	import {
		assIndicatorItem,
		persion_jf
	} from '@/common/api/req.js'
	import vTable from '../msgQuery/components/table-list.vue'
	export default {
		components: {
			vTable
		},
		data() {
			return {
				data: [],
				columns: [{
						title: "序号",
						key: "id",
						$width: '2em',

					},
					{
						title: '指标项',
						key: 'itemName',
						$width: '80px'
					},
					{
						title: '描述',
						key: 'itemDesc',
						// $width: '140px'
					},
					{
						title: '分值',
						key: 'score',
						$width: '4.5em'
					}
				],

			};
		},
		mounted() {

		},
		onLoad(option) {
			// 1：人员；2：企业
			if (option.type == 1) {
				this.getList()
			} else {
				this.getData()
			}
		},
		methods: {
			getData() {
				assIndicatorItem({}).then(res => {
					// console.log(res, '-------');
					let list = res.data.data
					list.forEach((item, index) => {
						item.id = index + 1
						item.score = item.score
					})
					this.data = list

					// console.log(list,'+++++');



				})
			},
			getList() {
				persion_jf({}).then(res => {
					// console.log(res, '-------');
					let list = res.data.data
					list.forEach((item, index) => {
						item.id = index + 1
						item.score = item.deductions
					})
					this.data = list
					// console.log(list,'+++++');
				})
			}
		}
	}
</script>

<style lang="scss">
	.viewpage {
		padding: 20rpx 0;
		text-align: center;
	}
</style>
